package com.caiyi.financial.nirvana.sms.service;

import com.caiyi.financial.nirvana.sms.base.service.BaseService;
import com.caiyi.financial.nirvana.sms.entity.SmsMate;
import com.caiyi.financial.nirvana.sms.mapper.SmsMateMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * \* User: ywg
 * \* Date: 2018/4/12
 * \* Time: 14:48
 * \* Description:
 * \
 */
@Service
public class SmsMateService extends BaseService<SmsMate> {
    @Autowired
    private SmsMateMapper smsMateMapper;


    /**
     * * 插入list
     *
     * @param list list
     */
    @Transactional
    public void insertList(List<SmsMate> list) {
        int res = smsMateMapper.insertList(list);
        logger.info("SmsMateService insertList size : {} , insert into return {}", list.size(), res);
        if (res != list.size()) {
            logger.error("SmsMateService DB Insert Error.");
        }
    }

    public List<SmsMate> selectMate() {
        return smsMateMapper.selectMate();
    }

}
